<style lang="less" scoped>
.component {
    width: 100%;
    height: 100%;
    .container {
        height: 100%;
        overflow-y: auto;
    }
    .loading {
        padding: 15px;
        color: #999;
        text-align: center;
    }
}
</style>
<template>
    <div class="component">
        <div class="container" ref="scrollContainer" id="scrollContainer">
            <div class="list">
                <slot></slot>
            </div>
            <MugenScroll :handler="onBottom" :should-handle="status == 1" scrollContainer="scrollContainer">
                <div class="loading">
                    <div v-if="status == 1">下拉加载</div>
                    <div v-if="status == 2">loading...</div>
                    <div v-if="status == 3">全部加载完</div>
                </div>
            </MugenScroll>
        </div>
    </div>
</template>
<script>
import MugenScroll from "vue-mugen-scroll";
export default {
    data() {
        return {
            // scrollContainer: this.$refs.scroll,
        };
    },
    props: {
        list: {
            type: Array,
            default: function(){
                return []
            }
        },
        status: {
            type: Number,
            default: 1
        }
    },
    components: {
        MugenScroll
    },
    methods: {
        onBottom() {
            this.$emit("onBottom")
        },
    },
    mounted() {
    }
};
</script>
